package com.wxl52d41.controller;

import com.wxl52d41.Service.CacheTestService;
import com.wxl52d41.vo.TestUserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: CacheTestController
 * @Description: CacheTestController
 * @Author: wang xiao le
 * @Date: 2022/12/05 20:01
 **/
@RestController
@RequestMapping("/Cache")
public class CacheTestController {

    @Autowired
    private CacheTestService cacheTestService;

    @GetMapping("queryUserByName")
    public TestUserVo queryUserByName() {
        return  cacheTestService.queryUserByName("小明");
    }

    @PutMapping("updateUser")
    public void updateUser() {
        TestUserVo userVo = new TestUserVo();
        userVo.setUserName("小明");
        userVo.setEmail("1321@qq.com");
        cacheTestService.updateUser(userVo);
    }

}
